package com.zhongjianjian.RabbitMq.config;

import org.springframework.amqp.AmqpException;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessagePostProcessor;
import org.springframework.amqp.rabbit.support.CorrelationData;

/**
 * @类名: com.zhongjianjian.RabbitMq.config
 * @作者: lgt
 * @创建时间: 2020-03-02 21:46
 * @描述:
 **/

public class MyMessagePostProcessor implements MessagePostProcessor {
    @Override
    public Message postProcessMessage(Message message) throws AmqpException {
       message.getMessageProperties().setExpiration("10000");//单位是毫秒
        return message;
    }
}
